function createTerrain(self) {
  var terrain = new THREE.Object3D()


  var mat1 = new THREE.PointCloudMaterial({
    vertexColors: true, sizeAttenuation: true,
    map: self.blobTextures[0], transparent: true,
    opacity: 0.25
  })

  mat1.blending = THREE.AdditiveBlending

  var mat2 = new THREE.PointCloudMaterial({
    vertexColors: true, sizeAttenuation: true,
    map: self.blobTextures[0], transparent: true,
    opacity: 0.25
  })

  mat2.blending = THREE.AdditiveBlending
  mat1 = mat2 = self.landscapeShaderMaterial
  mat2.blending = THREE.AdditiveBlending
  self.landscapeShaderMaterial.uniforms.map.value = self.blobTextures[0]

  terrain.add(
    new THREE.PointCloud(self.landscapeGeo1, mat1),
    new THREE.PointCloud(self.landscapeGeo2, mat2)
  );

  console.log(self.blobTextures[0])

  terrain.frustumCulled = false
  terrain.scale.set(2, 2, 4.5)
  terrain.position.set(0, -20, 0)

  return terrain;
}

/**
 * terrain: 地形
 * @param Incident
 */
export default function mixinTerrain(Incident) {

  Incident.prototype.createTerrain = function (LandscapeCoords) {
    this.landscapeCoords = LandscapeCoords

    var verts = new Float32Array(LandscapeCoords[0].coords)
    var colors = new Float32Array(LandscapeCoords[0].colors)


    for (var i = 0; i < verts.length; i++) {
      verts[i] = (verts[i] / 65535) * 447 - 227
      colors[i] = (colors[i] / 16) * (0.63 - 0.365) + 0.365
    }

    this.landscapeGeo1 = new THREE.BufferGeometry()
    this.landscapeGeo1.addAttribute( 'position', new THREE.BufferAttribute( verts, 3 ) )
    this.landscapeGeo1.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) )

    var verts = new Float32Array(LandscapeCoords[1].coords)
    var colors = new Float32Array(LandscapeCoords[1].colors)

    for (var i = 0; i < verts.length; i++) {
      verts[i] = (verts[i] / 65535) * 447 - 216
      colors[i] = (colors[i] / 16) * (0.63 - 0.365) + 0.365
    }

    this.landscapeGeo2 = new THREE.BufferGeometry()
    this.landscapeGeo2.addAttribute( 'position', new THREE.BufferAttribute( verts, 3 ) )
    this.landscapeGeo2.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) )

    this.terrain = createTerrain(this);


    this.scene.add(this.terrain);
    console.log('LandscapeCoords: => ', this.scene)
  }
}
